﻿<%@ Page Language="C#" MasterPageFile="Admin.master" %>
<%@ Register src="../module/UpFile.ascx" tagname="UpFile" tagprefix="inal" %>
<%@ Register src="../module/Types.ascx" tagname="Types" tagprefix="inal" %>

<script runat="server">
    private int Item_Id = 0;
    private Advertisement Ad;
    protected void Page_Load(object sender, EventArgs e)
    {
        Item_Id = Convert.ToInt32(Request.QueryString["Id"].ToString().Trim());
        Ad = new Advertisement(Item_Id);
    }    
</script>


<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script type="text/javascript">
        /* 维吾尔文输入法停止 */
        attachAll=false;
        bedit_allow = "Item_Title";
        /* 数据绑定 */
        $(document).ready(function(){
            $("#Item_IsShow").val(<%=Ad.Item_IsShow %>);
            $("#Typ10_0").val(<%=Ad.Item_Column %>);
            if (GetVal("id") == 0 && GetVal("cid") != 0)
                $("#Typ10_0").val(GetVal("cid"));
            /* 时间选择器,只能选择明天起，最多12个月 */
            $( "#Maturity_Time" ).datepicker({ 
                minDate: 1, 
                maxDate: "+1y",
                altFormat: "yy-dd-mm",
                changeMonth: true
            });
            $( "#Maturity_Time" ).change(function(){
                $( "#Maturity_Time" ).datepicker( "option", "dateFormat","yy/mm/dd 00:00:00");
            })


           
        });
        /* 编辑激活 */
        var Item_Img=<%=Ad.Create_Time.ToString("yyyyMMddHHmmss") %>;
        var Item_Time="<%= Ad.Create_Time.ToString("yyyy/MM/dd HH:mm:ss")%>";
    </script>


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"><%=Lang.Show("HomeBigAdvertisement")%> - <%=Lang.Show("Edit") %>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<table class="inputs">
    <tr>
        <td class="text"><%=Lang.Show("Columns") %> :</td>
        <td><inal:Types runat="server" Type="10" /></td>
        <td><div id="Validate-Typ10_0"></div></td>
        <td></td>
    </tr>
    <tr>
        <td><%=Lang.Show("Title") %> (<code title='<%=Lang.Show("MaxLength")%>' id="Item_Title_Code"><%=320-Ad.Item_Title.Length %></code>) : </td>
        <td><input type="text" name="Item_Title" id="Item_Title" maxlength="320" value="<%=Ad.Item_Title %>" /></td>
        <td><div id="Validate-Item_Title"></div></td>
        <td></td>
    </tr>
    <tr>
        <td><%=Lang.Show("Link") %> : </td>
        <td><input type="url"  value="<%=Ad.Item_Url %>" id="Item_Url" /></td>
        <td></td>
        <td></td>
    </tr>
    <tr>
        <td><%=Lang.Show("Order") %>  : </td>
        <td><input type="number" maxlength="3" min="1" max="254" value="<%=Ad.Orders %>" id="Orders" /></td>
        <td><div id="Validate-Orders"><%=Lang.Show("OrderDirections")%></div></td>
        <td></td>
    </tr>
    <tr>
        <td><%=Lang.Show("ExpiredTime") %>  : </td>
        <td class="maturity_time"><input type="datetime"  id="Maturity_Time"  class="cn" value="<%=Ad.Maturity_Time.ToString("yyyy/MM/dd 00:00:00") %>" /></td>
        <td><div id="Validate-Maturity_Time"><%=Lang.Show("ExpiredTimeDescription")%></div></td>
        <td></td>
    </tr>


    <tr>
        <td><%=Lang.Show("Picture") %> : </td>
        <td><inal:UpFile runat="server" Folder="Ad" Item_Extension="*.jpg;*.gif" Obj_Typ="10" Item_Typ="1" Cat_Height="450" Cat_Width="980" /></td>
        <td></td>
        <td></td>
    </tr>
    <tr>
        <td><%=Lang.Show("ItemCss")%> : </td>
        <td><textarea id="Item_Css" class="code"  rows="6"><%=Ad.Item_Css %></textarea></td>
        <td></td>
        <td></td>
    </tr>
    <tr>
        <td></td>
        <td><button onclick="Advertisement_AddEdit(<%=Request.QueryString["id"] %>)" class="button"><%=Lang.Show("Submit") %></button></td>
        <td></td>
        <td></td>
    </tr>
</table>
<script language="javascript" type="text/javascript">
    ShowLimitLength(320, "Item_Title");
</script>
</asp:Content>

